Imports Clo = Enhancements.Core.Logging
Imports Ref = System.Reflection
Imports Sys = System

Namespace Enhancements.Basic.Expressions.Functions
    ''' <summary>The exception that is thrown when a result for use in a function signature is not valid.</summary>
    ''' <remarks>The InnerException property holds the exception that leads to the throwing of these exceptions.</remarks>
    <Serializable(), DebuggerStepThrough()> _
    Public NotInheritable Class FunctionSignatureResultIsValidNotException
        Inherits Exception

        Private Sub New(ByVal _result As FunctionSignatureResult, ByVal _innerException As Sys.Exception)
            MyBase.New(_innerException)
            Result = _result
        End Sub

        Private __Result As FunctionSignatureResult = Nothing
        ''' <summary>Gets the result that caused this exception.</summary>
        Public Property Result() As FunctionSignatureResult
            Get
                Return __Result
            End Get
            Private Set(ByVal _value As FunctionSignatureResult)
                __Result = _value
            End Set
        End Property

        ''' <summary>Throws an exception.</summary>
        ''' <param name="_result">Result that are causing the exception.</param>
        ''' <param name="_innerException">Exception that led to the throwing of this exception.</param>
        ''' <exception cref="FunctionSignatureResultIsValidNotException"> </exception>
        Friend Shared Sub ___Throw(ByVal _result As FunctionSignatureResult, ByVal _innerException As Sys.Exception)
            Dim _exception As FunctionSignatureResultIsValidNotException = New FunctionSignatureResultIsValidNotException(_result, _innerException)

            Throw _exception
        End Sub

    End Class
End Namespace
